package org.blogwu.learn.multithread.chapter6.class3;

import java.util.Arrays;
import java.util.function.BinaryOperator;
import java.util.function.IntConsumer;

public class Main1 {

    static int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};

    public static void main(String[] args) {
        Arrays.stream(arr).forEach(new IntConsumer() {
            @Override
            public void accept(int value) {
                System.out.println(value);
            }
        });

        System.out.println("------");
        Arrays.stream(arr).forEach((int va) -> System.out.println(va));
        System.out.println("--3----");
        Arrays.stream(arr).forEach(System.out::println);

        BinaryOperator<Integer> adl = (i, b) -> i * b;
        System.out.println(adl.apply(1, 2));
    }
}
